package com.health.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ghy
 * @version 1.0
 * @since 2025-06-23 16:19
 */
@Mapper
public interface CheckgroupCheckitemMapper {

    @Select("select count(*) from t_checkgroup_checkitem where checkitem_id = #{checkitemId}")
    Integer countByCheckitem(Integer checkitemId);

    @Select("select checkitem_id from t_checkgroup_checkitem where checkgroup_id = #{checkgroupId}")
    List<Integer> selectCheckitemIdsByCheckgroupId(Integer checkgroupId);

    @Delete("delete from t_checkgroup_checkitem where checkgroup_id = #{checkgroupId}")
    void deleteByCheckgroupId(Integer checkgroupId);

    void insertBatch(@Param("checkitemIds") Integer[] checkitemIds, @Param("checkgroupId") Integer checkgroupId);
}
